					**This file runs panel specifications to create overall estimate of number**	

			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			
use removalcounts, clear

**make indicator for original data
gen original = 1

**append
append using removalcounts

**change monthlysanctuary indicator to 0 for all nonoriginal data
replace monthlysanctuary = 0 if original == .


***
**Run panel regression
***

glm countymonthlytotal i.month i.statecounty monthlysanctuary if original == 1, family(nbinomial ml) ///
cluster(state) link(log) irls


***
**Predict
***

*totals
predict counthat if original == . & countymonthlyto < .
predict counthat2 if original == 1 & countymonthlyto < .

**how many deportations prevented in 2013-2015?
tabstat counthat if original == . & month >= m(2013m1) & month <= m(2015m12), stat(sum mean) 
tabstat counthat2 if original == 1 & month >= m(2013m1) & month <= m(2015m12), stat(sum mean)

*subtract
disp 175246.9-152906.5
*22340.4

*percentage
disp (175246.9-152906.5) / 152906.5

***
**Run panel regression for no convictions
***

glm threat0count i.month i.statecounty monthlysanctuary if original == 1, family(nbinomial ml) ///
cluster(state) link(log) irls


***
**Predict
***

drop counthat*

*totals
predict counthat if original == . & countymonthlyto < .
predict counthat2 if original == 1 & countymonthlyto < .

**how many deportations prevented in 2013-2015?
tabstat counthat if original == . & month >= m(2013m1) & month <= m(2015m12), stat(sum mean) 
tabstat counthat2 if original == 1 & month >= m(2013m1) & month <= m(2015m12), stat(sum mean)

*subtract
disp 17529.36-14169.46
*3359.9

*percentage
disp (17529.36-14169.46) / 14169.46







